<?php
if(!isset($conflits))
	exit();
	
/**
 * Collones
 */
echo '<p>Liste des conflits dans la base :</p>';
echo '<table border=1>';
echo '<tr>';
	echo '<th>ID</th>';
	echo '<th>Nom</th>';
	echo '<th>Wiki</th>';
	echo '<th>Nombre de morts</th>';
	echo '<th>Nombre de blessés</th>';
	echo '<th>Debut</th>';
	echo '<th>Fin</th>';
	echo '<th> </th>';
	echo '<th> </th>';
echo '</tr>';

/**
 * Lignes
 */
foreach($conflits as $c) {
	echo '<tr>';
		echo '<td>' . $c->get_idconflit() . '</td>';
		echo '<td>' . $c->get_nomconflit() . '</td>';
		echo '<td><a href="'.$c->get_wikiconflit().'">'.$c->get_wikiconflit().'</a></td>';
		echo '<td>' . $c->get_mortsconflit() . '</td>';
		echo '<td>' . $c->get_blessesconflit() . '</td>';
		echo '<td>' . $c->get_debut() . '</td>';
		echo '<td>' . $c->get_fin() . '</td>';
			echo '<td><a href="?section=conflit&action=show&id='.$c->get_idconflit().'"><button type="submit" name="id">+</button></a></td>';
		if(isset($_SESSION['isAdmin'])){
			echo '<td><a href="?section=conflit&action=delete&id='.$c->get_idconflit().'"><button type="submit" name="id">-</button></a></td>';
		}
	echo '</tr>';
}
echo '</table>';

?>
